<!doctype html>
<html class="no-js fixed-layout">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>常德市前列腺疾病研究所</title>
  <meta name="description" content="常德市前列腺疾病研究所">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="/assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="/assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="/assets/css/admin.css">
  <!--引入wangEditor.css-->
<link rel="stylesheet" type="text/css"
	href="/wangediter/css/wangEditor.min.css">
	  
<link rel="stylesheet" type="text/css" href="../../uploadify/uploadify.css">
<script type="text/javascript">

</script>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->
#if(expert.content??==null)
#set(content='<p><br></p>')
#else
#set(content=expert.content)
#end
#if(session.username??==null)
<div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg"><a href="/admin/login">请先登录</a></strong></div>
      </div>
    </div>
    </div>

#else
#@top()
#define topcontent()
#end

<div class="am-cf admin-main">
#@left()
#define leftcontent()
#end

<!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">#(name)简介</strong></div>
      </div>

      <hr/>

      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-12">
          <form class="am-form am-form-horizontal" action="/admin/expert/save" method="post">
          <input type="hidden" name="expert.id" value="#(expert.id??)">
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">姓名 :</label>
              <div class="am-u-sm-11">
                <input type="text" id="user-name" placeholder="姓名 / Name" name="expert.name" value="#(expert.name??)" maxlength="5" required/>
                <small>输入专家姓名。</small>
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">科室 :</label>
              <div class="am-u-sm-11">
               <select id="doc-select-1"  name="expert.department" required>
         #for(department :department)
        <option value="#(department.did)" #if(department.did==expert.department??)selected="selected" #end>#(department.title)</option>
        #end
</select>
 <span class="am-form-caret"></span>
              </div>
            </div>
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">擅长 :</label>
              <div class="am-u-sm-11">
                <input type="text" id="user-name" placeholder="擅长 / Good" name="expert.good" value="#(expert.good??)" required/>
                <small>输入专家擅长。</small>
              </div>
            </div>
             <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">职称 :</label>
              <div class="am-u-sm-11">
                <input type="text" id="user-name" placeholder="职称 / Positionaltitles" name="expert.positionaltitles" value="#(expert.positionaltitles??)" required/>
                <small>输入专家职称。</small>
              </div>
            </div>
             <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">电话 :</label>
              <div class="am-u-sm-11">
                <input type="number" id="user-name" placeholder="电话 / Tel" name="expert.tel" value="#(expert.tel??)" required/>
                <small>输入专家咨询电话。</small>
              </div>
            </div>
                 <div class="am-form-group">
                                    <label for="user-weibo" class="am-u-sm-1 am-form-label">照片: </label>
                                    <div class="am-u-sm-11">
                                        <div class="am-form-group am-form-file">
                                            <div class="tpl-form-file-img" id="url" >
                                               #if(expert.img??!='' && expert.img??!=null)
                                                   <img alt="" src="#(expert.img)" width="180px;" height="150px;">
                                                  
                                                 
                                                  
                                                  #else
                                                  <input type="file" name="file_upload" id="file_upload"> 
                                               #end
                                            	 	
                                            </div>
                                            
                                        </div>

                                    </div>
                                </div>
            <div class="am-form-group">
              <label for="user-name" class="am-u-sm-1 am-form-label">简介:</label>
              <div class="am-u-sm-11">
                <textarea class="" rows="10"   style="resize:none;" placeholder="输入专家简介" name="expert.content">#(expert.content??)</textarea>
              </div>
            </div>

            <div class="am-form-group">
              <div class="am-u-sm-12 am-u-sm-push-6">
                <button type="submit" class="am-btn am-btn-primary">保存修改</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2017 Weirdor.</p>
    </footer>

  </div>
  <!-- content end -->

</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
#end
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/assets/js/amazeui.min.js"></script>
<script src="/assets/js/app.js"></script>
 <script src="../../uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
   <script type="text/javascript">
		$(function() {
			$('#file_upload').uploadify(
							{
								//校验数据

								'swf' : '../../uploadify/uploadify.swf', //指定上传控件的主体文件，默认‘uploader.swf’
								'uploader' : '/upload/uploads', //指定服务器端上传处理文件’
								'auto' : true, //手动上传
								'buttonImage' : '../../uploadify/uploadify-browse.png', //浏览按钮背景图片
								'multi' : true, //单文件上传
								'fileTypeExts' : '*.gif; *.jpg; *.png', //允许上传的文件后缀
								'fileSizeLimit' : '1MB', //上传文件的大小限制，单位为B, KB, MB, 或 GB
								'successTimeout' : 30, //成功等待时间
								'onUploadSuccess' : function(file, data,
										response) {//每成功完成一次文件上传时触发一次
									
									var image=eval("["+data+']')[0];
										$('#url').append(
												"<img  width=200 height=50 src="+image.fileName+" class='am-img-circle am-img-thumbnail'>"
										+"<input type='hidden' name='expert.img' value="+image.fileName+">"	
										);
									    document.getElementById('file_upload').style.display = "none";
									    
									//var image=eval(data);
									//alert(image[0]["big"]);
								},
								'onUploadError' : function(file, data, response) {//当上传返回错误时触发
									$('#url').append("<li>" + data + "</li>");
								}
							});
		});
	</script> 

</body>
</html>
